package com.ext.aic.box.wx.conversation;

import android.accessibilityservice.AccessibilityService;
import android.graphics.Rect;
import android.util.Log;

import com.ext.aic.events.OnAccessibilityServiceEvent;
import com.ext.aic.utils.BoxUtils;
import com.ext.aic.utils.ScreenRegionUtils;
import com.eyinfo.android_pure_utils.events.Action1;

public class ConversationScreenshot implements Runnable {
    private Rect rect;
    private Action1<Long> doneCallback;

    public ConversationScreenshot(Rect rect, Action1<Long> doneCallback) {
        this.rect = rect;
        this.doneCallback = doneCallback;
    }

    @Override
    public void run() {
        Log.d("conversation", "【2】开始执行截图任务");
        OnAccessibilityServiceEvent serviceEvent = BoxUtils.getInstance().getServiceEvent();
        AccessibilityService service = serviceEvent.getService();
        ScreenRegionUtils.getInstance().takeScreenshot(service, rect, doneCallback);
    }
}
